<template>
    

      <!-- :unique-opened="true" 每次只打开一个菜单项 -->
      <el-menu
      :default-active="routerString"
      class="el-menu-vertical-demo"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#409EFF"
      :collapse="isCollapse"
      :unique-opened="true"
      :collapse-transition="false"
      :router="true">
      <!-- router属性 可以将index当成路由地址 没有以 / 开头 手动加上-->
      <el-submenu :index="item.id + ''" v-for="item of menuslist" :key="item.id" >
        <template slot="title" >
          <i :class="iconObj[item.id]"></i>
          <span>{{item.authName}}</span>
        </template>
        
        
          
        <el-menu-item   :default-active="routerString" :index= "'/' + ite.path + ''" v-for="ite of item.children" :key="ite.id"
         @click="OnsaveNavState('/' + ite.path + '',item.authName,ite.authName)">
          <i class="el-icon-menu"></i>
          <span>{{ite.authName}}</span>
        </el-menu-item>
          
       
      </el-submenu>
      </el-menu>
    
</template>

<script>
    export default {
        props:["menuslist","isCollapse","iconObj",'OnsaveNavState',"routerString"]
    }
</script>

<style lang="less" scoped>
    .el-menu{
        height: 100% !important;
        border: none;
    }
    .iconfont{
      margin-right: 10px;
    }
</style>
<style>
    
    
</style>
